namespace Akso.Migrations
{
    using System;
    using System.Collections.Generic;
    using System.Data.Entity.Infrastructure.Annotations;
    using System.Data.Entity.Migrations;
    
    public partial class Add_Vendor_and_Inbound : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Inbounds",
                c => new
                    {
                        Id = c.Guid(nullable: false),
                        Vendor = c.String(nullable: false, maxLength: 50),
                        Delivery = c.String(maxLength: 100),
                        InvoiceNumber = c.String(maxLength: 50),
                        MaterialNo = c.String(maxLength: 50),
                        MaterialNameEn = c.String(maxLength: 150),
                        MaterialNameCn = c.String(maxLength: 150),
                        Qty = c.Int(nullable: false),
                        NetWeight = c.Decimal(precision: 18, scale: 3),
                        GrossWeight = c.Decimal(precision: 18, scale: 3),
                        NetPrice = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Amount = c.Decimal(precision: 18, scale: 3),
                        PONumber = c.String(maxLength: 50),
                        IsDeleted = c.Boolean(nullable: false),
                        DeleterUserId = c.Long(),
                        DeletionTime = c.DateTime(),
                        LastModificationTime = c.DateTime(),
                        LastModifierUserId = c.Long(),
                        CreationTime = c.DateTime(nullable: false),
                        CreatorUserId = c.Long(),
                    },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_Inbound_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Vendors",
                c => new
                    {
                        Id = c.Guid(nullable: false),
                        Name = c.String(nullable: false, maxLength: 50),
                        Address = c.String(maxLength: 150),
                        Contact = c.String(maxLength: 50),
                        ContactTelephone = c.String(maxLength: 50),
                        ContactMobile = c.String(maxLength: 50),
                        TotalCost = c.Decimal(precision: 18, scale: 4),
                        IsDeleted = c.Boolean(nullable: false),
                        DeleterUserId = c.Long(),
                        DeletionTime = c.DateTime(),
                        LastModificationTime = c.DateTime(),
                        LastModifierUserId = c.Long(),
                        CreationTime = c.DateTime(nullable: false),
                        CreatorUserId = c.Long(),
                    },
                annotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_Vendor_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.Vendors",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_Vendor_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
            DropTable("dbo.Inbounds",
                removedAnnotations: new Dictionary<string, object>
                {
                    { "DynamicFilter_Inbound_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
                });
        }
    }
}
